home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 36 / 036.d81 / relatively speak (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  302 lines

  1. 100 rem relatively speaking
  2. 200 jo=56320
  3. 300 gosub20600 
  4. 400 :
  5. 500 forx=1to5:readu$(x):next
  6. 600 data "years","days","hours","minutes","seconds"
  7. 700 :
  8. 800 forx=1to6:readl$(x):next
  9. 900 data "inches","feet","miles","centimeters","meters","kilometers"
  10. 1000 :
  11. 1100 c=300000:fl=0
  12. 1200 print"[147]";:gosub21200:pt=1
  13. 1300 printspc(7)"    - [212]ime transformations":print
  14. 1400 printspc(7)"    - [204]ength transformations":print
  15. 1500 printspc(7)"    - [205]ass transformations":print
  16. 1600 printspc(7)"    - [205]ass-energy relationships":print
  17. 1700 printspc(7)"    - [210]eturn to [204]oadstar"
  18. 1800 print"  [205]ove the arrow with the cursor keys"
  19. 1900 print" [208]ress [[210][197][212][213][210][206]] to make your selection."
  20. 2000 print"    [[202]oystick in [208]ort 2 also works]"
  21. 2100 print"";:forx=1topt:print"";:next:printspc(8)"==>[157][157][157]";
  22. 2200 ifpeek(198)=0andpeek(jo)=127then2200
  23. 2300 getag$:j%=peek(jo):print"   [144]"
  24. 2400 ifag$=""orj%=125thenpt=pt+1
  25. 2500 ifag$="[145]"orj%=126thenpt=pt-1
  26. 2600 ifag$=chr$(13)orj%=111then3100
  27. 2700 ifpt<1thenpt=5
  28. 2800 ifpt>5thenpt=1
  29. 2900 goto2100 
  30. 3000 :
  31. 3100 on pt goto3200 ,6700,10000,11800,26900
  32. 3200 print
  33. 3300 gosub15900
  34. 3400 gosub13900:print"[147]";:gosub21200
  35. 3500 print"  [215]ill the duration of the trip be in:":pt=1:f$="years"
  36. 3600 print""spc(12)"    [217]ears"
  37. 3700 printspc(12)"    [196]ays"
  38. 3800 printspc(12)"    [200]ours"
  39. 3900 printspc(12)"    [205]inutes"
  40. 4000 printspc(12)"    [211]econds"
  41. 4100 print"";:forx=1topt:print"";:next
  42. 4200 printspc(12)"==>[157][157][157]";
  43. 4300 ifpeek(198)=0andpeek(jo)=127then4300
  44. 4400 getag$:j%=peek(jo):print"   "
  45. 4500 ifag$=""orj%=125thenpt=pt+1
  46. 4600 ifag$="[145]"orj%=126thenpt=pt-1
  47. 4700 ifag$=chr$(13)orj%=111then5100
  48. 4800 ifpt<1thenpt=5
  49. 4900 ifpt>5thenpt=1
  50. 5000 goto4100 
  51. 5100 f$=u$(pt)
  52. 5200 print"      [200]ow long will the trip last"
  53. 5300 printspc(10);"==>";:ml=6:gosub19200:t=val(in$):gosub18000
  54. 5400 rem calculations and output for time transformations
  55. 5500 print"[147]";:gosub21200
  56. 5600 print"   [215]hen you return from your trip the"
  57. 5700 f1$="outside world will be":f2$=str$((1/x)*t)+" "+f$
  58. 5800 printspc(20-len(f1$)/2)f1$
  59. 5900 printspc(20-len(f2$)/2)f2$
  60. 6000 printspc(16)"older."
  61. 6100 rem continuation/discontinuation of program
  62. 6200 print"   [208]ress a key to return to the menu"
  63. 6300 ifpeek(198)=0andpeek(jo)<>111then6300
  64. 6400 poke198,0
  65. 6500 goto1200
  66. 6600 end
  67. 6700 print
  68. 6800 gosub15900
  69. 6900 gosub13900
  70. 7000 print"[147]";:gosub21200
  71. 7100 print"         [215]hat units will be used"
  72. 7200 pt=1:of=0:ifs$="m"thenof=3
  73. 7300 print""spc(10)"      "l$(1+of)
  74. 7400 printspc(10)"      "l$(2+of)
  75. 7500 printspc(10)"      "l$(3+of)
  76. 7600 print"";:forx=1topt:print"";:next
  77. 7700 printspc(10)"==>"
  78. 7800 ifpeek(198)=0andpeek(jo)=127then7800
  79. 7900 getag$:j%=peek(jo)
  80. 8000 ifag$=""orj%=125thenpt=pt+1
  81. 8100 ifag$="[145]"orj%=126thenpt=pt-1
  82. 8200 ifag$=chr$(13)orj%=111then8600
  83. 8300 ifpt<1thenpt=3
  84. 8400 ifpt>3thenpt=1
  85. 8500 goto7300 
  86. 8600 u$=l$(pt+of):gosub18000
  87. 8700 print"    [215]hat is the length of the object"
  88. 8800 printspc(10)"==>";:ml=6:gosub19200
  89. 8900 l=val(in$)
  90. 9000 rem calculations and output for length transformations
  91. 9100 nl=l-(x*l)
  92. 9200 w$="[212]he object will be"+str$(nl):w2$=u$+" shorter."
  93. 9300 print"[147]";:gosub21200:print
  94. 9400 printspc(20-len(w$)/2)w$
  95. 9500 printspc(20-len(w2$)/2)w2$
  96. 9600 print"      [212]his puts its new length at:"
  97. 9700 w$=str$(l-nl)+" "+u$+"."
  98. 9800 printspc(20-len(w$)/2)w$:goto6200
  99. 9900 print
  100. 10000 gosub15900
  101. 10100 gosub13900:gosub23300
  102. 10200 w$="in "+u$
  103. 10300 gosub18000
  104. 10400 print"[147]";:gosub21200 
  105. 10500 print"     [215]hat is the mass of the object":printspc(20-len(w$)/2)w$
  106. 10600 print"          <[206]umber value only>":printspc(11)"==>";:ml=6:gosub19200
  107. 10700 m=val(in$)
  108. 10800 rem calculations and output for mass transformations
  109. 10900 w$="[212]he object's mass has increased by":nm=(1/x)*m-m
  110. 11000 m$=str$(nm)+" "+u$+"."
  111. 11100 print"[147]";:gosub21200:print""spc(20-len(w$)/2)w$
  112. 11200 printspc(20-len(m$)/2)m$
  113. 11300 print"       [212]his puts its new mass at:"
  114. 11400 m$=str$(nm+m)+" "+u$+"."
  115. 11500 printspc(20-len(m$)/2)m$
  116. 11600 goto6200
  117. 11700 :
  118. 11800 gosub15900
  119. 11900 gosub23300
  120. 12000 print"[147]";:gosub21200:print"           [215]hat is the mass"
  121. 12100 w$="in "+u$:printspc(20-len(w$)/2)w$
  122. 12200 printspc(11)"==>";:ml=6:gosub19200:m=val(in$):m=m*di
  123. 12300 ifs$="e"thenm=m/2.3
  124. 12400 rem calculations and output for mass-energy relationship
  125. 12500 e=m*(300000^2):e=4190*e:print
  126. 12600 print"[147]  [201]f the mass of the object were to be"
  127. 12700 print"     totally converted into energy, "
  128. 12800 w$=str$(e)+" calories":hc=int(e/1.1804e13):hc$=str$(hc)
  129. 12850 z=len(hc$):ll=0:ifz>8thenll=1
  130. 12900 ef=0:forx=1toz:ifmid$(hc$,x,1)="e"thenef=1
  131. 13000 nextx
  132. 13005 ifll=1andef=0thenhc$=left$(hc$,2)+"."+mid$(hc$,3,1)+"+e"+mid$(str$(z-2),2)
  133. 13100 ifll=1andef=1thenhc$=left$(hc$,2)+right$(hc$,4)
  134. 13200 hc$=hc$+" times the energy"
  135. 13300 iflen(hc$)<25thenhc$=hc$+" ":goto13300
  136. 13400 printspc(20-len(w$)/2)w$
  137. 13500 printspc(11)"would be released."
  138. 13600 gosub28100 
  139. 13700 goto6200
  140. 13800 rem velocity-time-units conversion subroutine
  141. 13900 print"[147]";:gosub21200
  142. 14000 print"         [215]ill the velocity be:"
  143. 14100 t1$="s":f=1:me$="[205]iles":ifs$="m"thenme$="[203]ilometers":pt=1
  144. 14200 print""spc(7)"      "me$" per second"
  145. 14300 print""spc(7)"      "me$" per hour"
  146. 14400 print"";:forx=1topt:print"";:next
  147. 14500 printspc(9)"==>[157][157][157]";
  148. 14600 ifpeek(198)=0andpeek(jo)=127then14600
  149. 14700 getag$:j%=peek(jo):print"   "
  150. 14800 ifag$=""orj%=125thenpt=pt+1
  151. 14900 ifag$="[145]"orj%=126thenpt=pt-1
  152. 15000 ifag$=chr$(13)orj%=111then15400
  153. 15100 ifpt<1thenpt=2
  154. 15200 ifpt>2thenpt=1
  155. 15300 goto14400
  156. 15400 ifpt=2thent1$="h":f=3600
  157. 15500 print""
  158. 15600 printspc(9)"[215]hat is the velocity?":printspc(12)"-->";
  159. 15700 ml=6:gosub19200:v=val(in$):v=v/f:gosub18000 
  160. 15800 return
  161. 15900 print"[147]";:gosub21200
  162. 16000 print
  163. 16100 print"   [215]hich measurement system would you":printspc(13)"like to use?"
  164. 16200 s$="e":c=186000:pt=1
  165. 16300 print""spc(10)"     [197]nglish"
  166. 16400 print""spc(10)"     [205]etric"
  167. 16500 print"";:forx=1topt:print"";:next
  168. 16600 printspc(10)"==>[157][157][157]";
  169. 16700 ifpeek(198)=0andpeek(jo)=127then16700
  170. 16800 getag$:j%=peek(jo):print"   "
  171. 16900 ifag$=""orj%=125thenpt=pt+1
  172. 17000 ifag$="[145]"orj%=126thenpt=pt-1
  173. 17100 ifag$=chr$(13)orj%=111then17500
  174. 17200 ifpt<1thenpt=2
  175. 17300 ifpt>2thenpt=1
  176. 17400 goto16500 
  177. 17500 ifpt=2thens$="m":c=300000
  178. 17600 print""
  179. 17700 rem units choice and coversion subroutine
  180. 17800 m=1:l=1:ifs$="e"thenc=186000:iffl=1thenm=m*2.3
  181. 17900 return
  182. 18000 if(v>186000ands$="e")or(v>300000ands$="m")thengoto18400
  183. 18100 ifv=186000ands$="e"thenv=185999
  184. 18200 ifv=300000ands$="m"thenv=299999
  185. 18300 x=(1-(v/c)^2)^.5:return
  186. 18400 print:print"[147]    [206]o object can surpass the speed"
  187. 18500 printspc(14)"of light.
  188. 18800 [153][166]7)"(NULL)se velocities less than"
  189. 18900 m$[178]"300,000"[170]" kilometers/second."
  190. 19000 [139]s$[178]"e"[167]m$[178]" 186,000"[170]" feet/second."
  191. 19002 [153][166]19[171][195](m$)[173]2);
  192. 19100 [153]m$:[137]6200
  193. 19200 [143] input
  194. 19300 [143] pass max length in ml
  195. 19400 cu$[178]"tocmd":in$[178]""
  196. 19500 [153]cu$;:[151]198,0:[146]198,1:[161]a$:[153]" cmd";
  197. 19600 [139]a$[178][199](13)[167]20300
  198. 19700 [139]a$[179][177][199](20)[167]19900
  199. 19800 aw[178][195](in$):[139]aw[177]0[167]in$[178][200](in$,aw[171]1):[153]"cmd cmd";:[137]19500
  200. 19900 [139]a$[177][178]"0"[175]a$[179][178]"9"[167]20100
  201. 20000 [137]19500
  202. 20100 [139][195](in$)[179]ml[167]in$[178]in$[170]a$:[153]a$;
  203. 20200 [137]19500 
  204. 20300 [139][195](in$)[178]0[167]19500
  205. 20400 [142]
  206. 20500 :
  207. 20600 [153]"load":[151]53281,1:[151]53280,5
  208. 20700 [153]"         or{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}^"
  209. 20800 [153]"         {$7d}Loadstar presents{$7d}stop "
  210. 20900 [153]"         /{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}{$60}expstop "
  211. 21000 [153]"                             "
  212. 21100 [153]:[141]21200:[137]22400
  213. 21200 [153]
  214. 21300 [153]"    cont                              "
  215. 2